# _*_ coding: UTF-8 _*_
# @Time     : 2021/10/21 10:19
# @Author   : Gong Yangyi
# @Site     : http://www.hzdledu.cn/
# @File     : c4s1.py
# @Software : PyCharm
# 算术运算符
print(5 / 3)
print(5 % 3)  # 取余数
print(5 ** 3)  # 幂运算
print(5 // 3)  # 整除

# 比较/关系运算符
# 运算数据，得到布尔值
a = 5
b = 3
c = 1
print(a == b)  # false
print(a != b)  # true
print(a > b)  # true
print(a < b)  # false

print(5 > b and b > 1)  # True
print(a > b > c)
print('----------------------我是分割线------------------------------')
# 逻辑运算符
# 运算bool值，得到bool值
a = True
b = False
print(a and b)
print(a or b)
print(not a)

a = 1
b = 0
print(a and b)
print(a or b)
print(not a)

print('----------赋值运算符---------')
a = 10
b = 5
a += b  # a=a+b
print(a)

a = 1
b = 2
a += a * b  # a=a+(a*b)
print(a)

print('--------位和位移符-------------')
print(5 & 3)
print(5 | 3)
print(~ 5)
print(4 >> 1)
print(4 << 1)

print('--------其他运算符-------------')
# in:成员运算符，结果为bool值
print(3 in (3, 5, 7, 9))
print(3 not in (3, 5, 7, 9))
